
<template>
  <div>
    <div class="bigbox">
      <div class="content" v-for="(v, i) in arr" :key="i">
        <img :src="v.url" />
        <span class="span1">Switch</span>
        <span class="span1">Nintendo</span>
        <div class="name">{{ v.name }}</div>
        <span>{{ v.price }}</span>
        <span class="span2">二手 2.4折</span>
      </div>
    </div>
  </div>
</template>

<script>
import getlink from "../api/getapi";
export default {
  data() {
    return {
      arr: [],
    };
  },
  mounted() {
    getlink("/data/list").then((ok) => {
      this.arr = ok.data.you;
    });
  },
};
</script>

<style scoped>
.bigbox {
  width: 90%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  margin-top: 0.2rem;
  flex-wrap: wrap;
}
img {
  width: 1.65rem;
  height: 1.65rem;
}
.content {
  width: 47%;
  margin-bottom: 0.2rem;
}
.span1 {
  display: inline-block;
  height: 0.25rem;
  font-size: 0.13rem;
  background-color: #f4f7f4;
  line-height: 0.25rem;
  padding-left: 0.1rem;
  padding-right: 0.1rem;
  border-radius: 0.2rem;
  color: #497749;
}
.span2 {
  display: inline-block;
  height: 0.2rem;
  font-size: 0.13rem;
  line-height: 0.2rem;
  padding-left: 0.05rem;
  padding-right: 0.05rem;
  color: #c75943;
  margin-left: 0.1rem;
  border: 1px solid #d58372;
  border-radius: 0.05rem;
}
.name {
  margin: 0.1rem 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
</style>